<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
    <ul>
        <li ng-repeat="item in jsondata.list">
            {{item.name}}:{{item.city_id}}
        </li>
    </ul>
    <pre>
        {{jsondata|json}}
    </pre>
</body>
<script src="js/angular.js"></script>
<script>
    var app=angular.module('myApp',[]);
    app.controller('myCtrl',function ($scope,$http) {
        var url='http://api.yytianqi.com/citylist/id/1';
        //这个url因为在返回数据的时候含有  Access-Control-Allow-Origin 才能支持跨域
        //通过$http发送数据请求
        $http({
           url:url,
            method:'GET'
        })
            .then(function (response) {
            //成功的返回数据
            console.log('成功');
            console.log(response);
            $scope.jsondata=response.data;
        },function (response) {
            //失败的返回数据
            console.log('失败');
            console.log(response);
        });
//jquery
//        $.ajax({
//            url:'',
//            type:'GET',
//            suc:function (data) {
//
//            }
//        })
    })
</script>
</html>